// in caps because it's a global variable
var BASEPATH = '/adon/';

// Create UserManager
// Check if the user is logged
var UserManager = new UserManager();

//Create MapManager
var MapManager = new MapManager();

// Create ObjectManager
var ObjectManager = new ObjectManager();

/*
 * JS page initialization
 */
function initPageList()
{
	
	// load header
	$('#contentHeader').html('<img src="'+BASEPATH+'assets/img/ajax-loader.gif">');
	$('#contentHeader').load(BASEPATH+'pages/view_part/contentHeader');
	
	// set the page to 'list'
	ObjectManager.setPage('list');
	// refresh objects list
	//ObjectManager.refresh();
}

function initPageItem(id)
{
	
	// load header
	$('#contentHeader').html('<img src="'+BASEPATH+'assets/img/ajax-loader.gif">');
	$('#contentHeader').load(BASEPATH+'pages/view_part/contentHeader');
	

	// set the page to default
	ObjectManager.setPage('item');
	
	// refresh objects list
	ObjectManager.refresh('item', id, null);
}